import Mock from 'mockjs'

//图标数据
let List = []
export default {
    getStatistcalData: () => {
        //Mock.Random.float 产生随机数100到8000之间 保留小数  最小0位  最大0位
        //模拟生成数据的规则   push到Lish数组中
        for(let i = 0; i < 7; i++){
            List.push(
                Mock.mock({
                    苹果:Mock.Random.float(100,8000,0,0),
                    vivo:Mock.Random.float(100,8000,0,0),
                    oppo:Mock.Random.float(100,8000,0,0),
                    魅族:Mock.Random.float(100,8000,0,0),
                    三星:Mock.Random.float(100,8000,0,0),
                    小米:Mock.Random.float(100,8000,0,0),
                })
            )
        }
        return{
            code: 20000,
            data:{  
                //饼图
                videoData:[
                    {
                        name:'小米',
                        value:2999
                    },
                    {
                        name:'苹果',
                        value:5999
                    },
                    {
                        name:'vivo',
                        value:2988
                    },
                    {
                        name:'oppo',
                        value:1999
                    },
                    {
                        name:'魅族',
                        value:3200
                    },
                    {
                        name:'三星',
                        value:4899
                    },
                ],
                //柱状图
                userData:[
                    {
                        data:'周一',
                        new:15,
                        active:100
                    },
                    {
                        data:'周二',
                        new:52,
                        active:300
                    },
                    {
                        data:'周三',
                        new:56,
                        active:80
                    },
                    {
                        data:'周四',
                        new:10,
                        active:210
                    },
                    {
                        data:'周五',
                        new:20,
                        active:150
                    },
                    {
                        data:'周六',
                        new:9,
                        active:73
                    },
                    {
                        data:'周日',
                        new:55,
                        active:370
                    }
                ],
                // //折线图
                orderData:{
                    date:['20191001','20191002','20191003','20191004','20191005','20191006','20191007'],
                    data:List
                },
                tableData: [
                    {
                      name: "oppp",
                      todayBuy: 100,
                      monthBuy: 300,
                      totalBuy: 800,
                    },
                    {
                      name: "vivo",
                      todayBuy: 100,
                      monthBuy: 300,
                      totalBuy: 800,
                    },
                    {
                      name: "苹果",
                      todayBuy: 100,
                      monthBuy: 300,
                      totalBuy: 800,
                    },
                    {
                      name: "小米",
                      todayBuy: 100,
                      monthBuy: 300,
                      totalBuy: 800,
                    },
                    {
                      name: "三星",
                      todayBuy: 100,
                      monthBuy: 300,
                      totalBuy: 800,
                    },
                    {
                      name: "华为",
                      todayBuy: 100,
                      monthBuy: 300,
                      totalBuy: 800,
                    },
                ],
            }
        }
    }
    
}